#ifndef TAGITEM_H
#define TAGITEM_H

#include "DomORM.h"

enum TagType : int { UnknownType = 0, StringType, NumberType, CheckBoxType, RadioButtonType, BooleanType };

class SimpleTagItem : public SharedDomObject
{
public:
    SimpleTagItem(QDomElement source);
    int id();
    QString value();
    void setId(int id);
    void setValue(const QString &value);
    SimpleTagItem clone();

    static QString tagName() { return "tag"; }

};

class TagItem : public SharedDomObject
{
public:
    TagItem(QDomElement source);
    int id();
    QString name();
    QString type();
    QString log();
    QString value();
    void setId(int id);
    void setName(const QString &name);
    void setType(const QString &type);
    void setLog(const QString &log);
    void setValue(const QString &value);
    TagItem clone();

    static QString tagName() { return "tag"; }

protected:

    static TagType getTagType(const QString &typeName);
};

// class TagList
typedef ElementList<TagItem> TagList;

// class SimpleTagList
typedef ElementList<SimpleTagItem> SimpleTagList;

#endif // TAGITEM_H
